<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>{{$data.product.name}} {{:Config('system.app_name')}}</title>
{{include file='layouts/_layout'}}
<style type="text/css">
.zoomContainer {z-index: 2;}	
</style>
</head>
<body>
{{include file='layouts/_site_nav'}}
{{include file='layouts/_head'}}
{{include file='layouts/_menu'}}
<div class="product">
	<input type="hidden" id="product_id" value="{{$data.product.id}}" />
	<input type="hidden" id="sku" value="{{$data.product.sku}}" />
	<div class="container">
		<div class="pro-nav">
			{{$data.nav|raw}}
		</div>
		<div class="pro-box">
			<div class="pro-box-left">
				<div class="pro-images">
					<div class="large-image"><img src="{{$data.product.image_430x430}}" data-zoom-image="{{$data.product.image}}"></div>
					{{if isset($data.product.images)}}
					<div class="small-image">
						<ul>
							{{volist name="$data.product.images" id="vo"}}
							<li><img src="{{$vo.image_430x430}}" src_S="{{$vo.image}}" src_L="{{$vo.image}}"></li>
							{{/volist}}
						</ul>
					</div>
					{{/if}}
				</div>
				<div class="share">
					{{if $data.product.is_collect == 1}}
					<a class="collect on" href="javascript:void(0);" title="取消收藏" onclick="collectProduct({{$data.product.sku}}, 'cancel')">
						<i class="iconfont"></i>收藏
					</a>
					{{else}}
					<a class="collect" href="javascript:void(0);" title="收藏商品" onclick="collectProduct({{$data.product.sku}})">
						<i class="iconfont"></i>收藏
					</a>
					{{/if}}
					<a class="bdsharebuttonbox bds_more share-box none" style="background: none;"><i class="iconfont"></i>分享</a>
					<a class="report none">举报</a>
				</div>
			</div>
			<div class="pro-info">
				<h1 class="name">{{$data.product.name}}</h1>
				<div class="price">
					<dl class="sale-price"><dt>销售价</dt><dd><em>¥</em>{{$data.product.sale_price}}</dd></dl>
				</div>
				<div class="info">
					<div class="dt">配送至</div>
					<div class="dd freight">
						<span class="freight-address" title="点击选择配送地址">计算中</span>
						<div class="freight-select-address">
							<div class="top">
								<ul class="freight-address-top">计算中</ul>
							</div>
							<div class="box">
								<ul class="freight-regions freight-regions-1">1</ul>
								<ul class="freight-regions freight-regions-2">2</ul>
								<ul class="freight-regions freight-regions-3">3</ul>
							</div>
							<div class="close"><i class="iconfont">&#xe606;</i></div>
						</div>
					</div>
				</div>
				<div class="info">
					<div class="dt">运费</div>
					<div class="dd" id="freight_price">计算中</div>
				</div>
				<div class="server info">
					<div class="dt">服务</div>
					<div class="dd">由 {{:Config('system.app_name')}} 负责发货，并提供售后服务。</div>
				</div>
				{{volist name="$data.product.product_specifications" id="vo"}}
				<div class="info large-info attribute">
					<div class="dt" id="{{$vo.product_specification_id}}">{{$vo.specification_name}}</div>
					<div class="dd">
						{{volist name="$vo.options" id="vo_option"}}
						{{if isset($vo_option.valid)}}
						<a id="{{$vo_option.product_specification_option_id}}" {{if isset($vo_option.selected)}} href="javascript:void(0);" class="on" {{else}} href="{{:url('product/show', ['sku' => $vo_option.sku])}}" {{/if}}>{{$vo_option.specification_option_value}}</a>
						{{else}}
						<a id="{{$vo_option.product_specification_option_id}}" href="javascript:void(0);" class="no" title="无此产品">{{$vo_option.specification_option_value}}</a>
						{{/if}}
						{{/volist}}
					</div>
				</div>
				{{/volist}}
				<div class="info count large-info">
					<div class="dt">数量</div>
					<div class="dd">
						{{if $data.product.stock <= 0}}
						暂无库存
						{{else}}
						<a href="javascript:void(0);" onclick="setBuyCount('decline')">-</a><input id="count" type="text" value="1" onkeyup="validateCount()"><a href="javascript:void(0);" onclick="setBuyCount('increase')">+</a><span>库存：<em id="stock">{{$data.product.stock}}</em></span>
						{{/if}}
					</div>
				</div>
				{{if $data.product.stock > 0}}
				<div class="buy">
					<button class="nowbuy" onclick="onekeybuy();">立即购买</button><button class="addcart" onclick="addCart($('#sku').val(), $('#count').val())"><i class="iconfont">&#xe61b;</i>加入购物车</button>
				</div>
				{{/if}}
			</div>
			<div class="pro-box-right">
				<div class="pbr-top"><h2>看了又看<a href="javascript:void(0);" onclick="getRandProducts()"><i class="iconfont">&#xe787;</i></a></h2></div>
				<div class="items" id="shop_rand_product"></div>
			</div>
		</div>
		<div class="pro-detail">
			<div class="left">
				<div class="box box-products">
					<div class="box-top">推荐商品</div>
					<div class="box-con" id="shop_recommend_product"></div>
				</div>
			</div>
			<div class="right">
				<div class="top-nav">
					<ul>
						<li class="on" data-key="pd-specification">规格参数</li>
						<li data-key="pd-detail">商品详情</li>
					</ul>
				</div>
				<div class="pd">
					<div class="pd-specification">
						<ul>
							<li title="{{$data.product.name}}">商品名字：{{$data.product.name}}</li>
							<li>商品编号：{{$data.product.sku}}</li>
							{{volist name="data.product.attributes" id="vo"}}
							<li>{{$vo.product_attribute_name}}：{{$vo.product_attribute_value}}</li>
							{{/volist}}
						</ul>
					</div>
					<div class="pd-detail">{{$data.product.content|raw}}</div>
				</div>
			</div>
		</div>
	</div>
</div>
{{include file='shared/_right_sidebar'}}
{{include file='layouts/_foot_article'}}
{{include file='layouts/_foot'}}
<script type="text/javascript" src="/static/index/plugins/elevateZoom/jquery.elevatezoom.js?v={{:Config('version.pc.version')}}"></script>
<script type="text/javascript" src="/static/index/script/product.js?v={{:Config('version.pc.version')}}"></script>
<script type="text/javascript" src="/static/index/script/cart.js?v={{:Config('version.pc.version')}}"></script>
<script type="text/javascript" src="/static/index/plugins/jquery.fly/fly.js?v={{:Config('version.pc.version')}}"></script>
<script type="text/javascript">
$(document).ready(function () {
	initZoomImage();
	initFreight();
	getRandProducts();
	getRecommendProducts();
});

function onekeybuy()
{
	var url = '{{:url('checkout/onekeybuy')}}?sku={{$data.product.sku}}&count='+$('#count').val();
	window.location.href = url;
}
</script>
</body>
</html>